package mazewar.legacy;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


import java.io.Serializable;

/**
 *
 * @author jillsanluis
 */
public class NetworkPacket implements Serializable, Cloneable{

    private String srcName;
    private Integer srcSocket;
    private String dstName;
    private Integer dstSocket;
    private ClientSessionInput srcInput;

    private DirectedPoint srcDirectedPoint;
    
    private int windowWidth = 0;
    private int windowHeight = 0;
    
    public NetworkPacket(){
 
    }
  
    /**
     * @return the srcName
     */
    public String getSrcName() {
        return srcName;
    }

    /**
     * @param srcName the srcName to set
     */
    public void setSrcName(String srcName) {
        this.srcName = srcName;
    }

    /**
     * @return the srcSocket
     */
    public Integer getSrcSocket() {
        return srcSocket;
    }

    /**
     * @param srcSocket the srcSocket to set
     */
    public void setSrcSocket(Integer srcSocket) {
        this.srcSocket = srcSocket;
    }

    /**
     * @return the dstName
     */
    public String getDstName() {
        return dstName;
    }

    /**
     * @param dstName the dstName to set
     */
    public void setDstName(String dstName) {
        this.dstName = dstName;
    }

    /**
     * @return the dstSocket
     */
    public Integer getDstSocket() {
        return dstSocket;
    }

    /**
     * @param dstSocket the dstSocket to set
     */
    public void setDstSocket(Integer dstSocket) {
        this.dstSocket = dstSocket;
    }

    /**
     * @return the srcInput
     */
    public ClientSessionInput getSrcInput() {
        return srcInput;
    }

    /**
     * @param srcInput the srcInput to set
     */
    public void setSrcInput(ClientSessionInput srcInput) {
        this.srcInput = srcInput;
    }

    @Override
    public NetworkPacket clone(){
        NetworkPacket clone = new NetworkPacket();

        clone.setDstName(dstName);
        clone.setDstSocket(dstSocket);
        clone.setSrcDirectedPoint(srcDirectedPoint);
        clone.setSrcInput(srcInput);
        clone.setSrcSocket(srcSocket);
        clone.setSrcName(srcName);
        clone.setWindowHeight(windowHeight);
        clone.setWindowWidth(windowWidth);
        
        return clone;
    }

    /**
     * @return the srcDirectedPoint
     */
    public DirectedPoint getSrcDirectedPoint() {
        return srcDirectedPoint;
    }

    /**
     * @param srcDirectedPoint the srcDirectedPoint to set
     */
    public void setSrcDirectedPoint(DirectedPoint srcDirectedPoint) {
        this.srcDirectedPoint = srcDirectedPoint;
    }

    /**
     * @return the windowWidth
     */
    public int getWindowWidth() {
        return windowWidth;
    }

    /**
     * @param windowWidth the windowWidth to set
     */
    public void setWindowWidth(int windowWidth) {
        this.windowWidth = windowWidth;
    }

    /**
     * @return the windowHeight
     */
    public int getWindowHeight() {
        return windowHeight;
    }

    /**
     * @param windowHeight the windowHeight to set
     */
    public void setWindowHeight(int windowHeight) {
        this.windowHeight = windowHeight;
    }

    @Override
    public String toString(){
        StringBuilder sb = new StringBuilder();

        sb.append("source: ");
        sb.append(srcName);
        sb.append(" ");
        sb.append("dest: ");
        sb.append(dstName);
        sb.append(" ");
        sb.append(srcDirectedPoint.getDirection());
        sb.append(" ");
        sb.append(srcDirectedPoint.getX());
        sb.append(" ");
        sb.append(srcDirectedPoint.getY());
        return sb.toString();
    }
}
